import { BaseService } from "@cool-midway/core";
import { Provide } from "@midwayjs/core";
import { InjectEntityModel } from "@midwayjs/typeorm";
import { Repository } from "typeorm";
import { FinanceWalletEntity } from "../entity/wallet";

@Provide()
export class FinanceWalletService extends BaseService {
    @InjectEntityModel(FinanceWalletEntity)
    financeWalletEntity: Repository<FinanceWalletEntity>;

    /**
     * 创建钱包
     * @param relatedId 关联ID
     * @param relatedType 关联类型
     */
    async createWallet(relatedId: number, relatedType: 'user' | 'provider') {

        const isExists = await this.financeWalletEntity.exists({ where: { relatedId, relatedType } });
    }
}